<template>
  <div class='container'>
    <el-dialog title="预览文章" :visible="showDialog" width="800px" @close="close">
      <el-row>
        <el-col :span="24">
          <div class="grid-content bg-purple-dark">
            <h2>{{ shuju.title }}</h2>
          </div>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="24">
          <div class="zz">
            <span class="grid-content hezi">{{shuju.createTime}}</span>
            <span class="grid-content hezi">{{shuju.username}}</span>
            <i class="el-icon-view hezi"></i>
            <span class="grid-content hezi">{{shuju.visits}}</span>
          </div>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="24" style="background-color:#f4f4f5">
          <div class="yanse" v-html="shuju.articleBody" center>
            {{ shuju.articleBody }}
          </div>
        </el-col>
      </el-row>
    </el-dialog>
  </div>
</template>

<script>
export default {
  props: {
    showDialog: {
      type: Boolean,
      default: false
    },
    shuju: {
      type: Object,
      default: () => ({})
    }
  },
  methods: {
    close () {
      this.$emit('closeVW', false)
    }
  }
}
</script>

<style scoped lang='scss'>
h2 {
  margin-top: 0;
  margin-bottom: 10px;
}
.yangshi {
  margin-left: 10px;
}
.zz {
  border-bottom: 1px dotted;
  padding-bottom: 10px;
}
.hezi {
  display: inline-block;
  margin-left: 10px;
}
.yanse {
  padding: 10px;
  display: table-cell;
  vertical-align: middle;
}
</style>
